home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Documentation / Autodocs / palette_gc.doc < prev    next >
Encoding:
Text File  |  1999-10-29  |  5.0 KB  |  151 lines

  1. TABLE OF CONTENTS
  2.  
  3. palette_gc/--datasheet--
  4. palette_gc/--styleguide--
  5. palette_gc/PALETTE_GetClass
  6. palette_gc/--datasheet--                             palette_gc/--datasheet--
  7.  
  8.      NAME
  9.         palette_gc -- A colour selection gadget.
  10.  
  11.      SUPERCLASS
  12.         gadgetclass
  13.  
  14.      REQUIRES
  15.         bevel.image
  16.  
  17.      DESCRIPTION
  18.         This gadget is equivalent to the GadTools PALETTE_KIND gadget, but
  19.         implemented as a BOOPSI gadget class.  It displays a palette of
  20.         colours, allowing the user to select one.
  21.  
  22.         Advantages that this class provides:
  23.  
  24.          > Right mouse button cancels gadget action.
  25.  
  26.          > Supports window relativity.
  27.  
  28.          > Supports gadget interconnections.
  29.  
  30.          > Supports OS 3.0 BOOPSI Gadget HelpTest.
  31.  
  32.      METHODS
  33.         OM_NEW -- Create the palette gadget, calls OM_SET.  Passed to
  34.             superclass.
  35.  
  36.         OM_SET -- Set object attributes.  Passed to superclass first.
  37.  
  38.         OM_GET -- Get object attributes.  Passed to superclass first.
  39.  
  40.         OM_NOTIFY -- Notify connections of attribute changes.
  41.  
  42.         OM_DISPOSE -- Frees resources and calls superclass.
  43.  
  44.         OM_UPDATE -- Calls OM_SET.
  45.  
  46.         GM_DOMAIN -- Return the maximum and minimum size of the gadget.
  47.  
  48.         GM_RENDER -- Renders the gadget imagry.  Overrides the superclass.
  49.  
  50.         GM_KEYACTIVE -- Handles keyboard activation.
  51.  
  52.         GM_KEYINACTIVE -- Handles keyboard de-activation.
  53.  
  54.         GM_GOACTIVE -- Activate the gadget on mouse click only.  Overrides
  55.             the superclass.
  56.  
  57.         GM_HANDLEINPUT -- Handles input events once active.  Overrides the
  58.             superclass.
  59.  
  60.         GM_GOINACTIVE -- Deactivates the gadget.  Passed to the superclass.
  61.  
  62.         All other methods are passed to the superclass.
  63.  
  64.      ATTRIBUTES
  65.         GA_Disabled (BOOL)
  66.             Set to TRUE to disable gadget, FALSE otherwise
  67.  
  68.             Defaults to FALSE.
  69.  
  70.             Applicability is (OM_NEW, OM_SET, OM_GET)
  71.  
  72.         PALETTE_Colour (UBYTE)
  73.             Initially selected color of the palette. This number is a pen
  74.             number, and not the ordinal color number within the palette
  75.             gadget itself.  The exception is when PALETTE_ColourTable is
  76.             used, in which case you will get an index into your table.
  77.  
  78.             Defaults to 0.
  79.  
  80.             Applicability is (OM_NEW, OM_SET, OM_GET)
  81.  
  82.         PALETTE_ColourOffset (UBYTE)
  83.             First color to use in screen palette.
  84.  
  85.             Defaults to 0.
  86.  
  87.             Applicability is (OM_NEW, OM_SET, OM_GET)
  88.  
  89.         PALETTE_ColourTable (UBYTE *)
  90.             Pointer to a table of pen numbers indicating  which colors
  91.             should be used and edited by the palette gadget. This array
  92.             must contain as many entries as there are colors displayed in
  93.             the palette gadget PLUS the colour offset.  The array provided
  94.             with this tag must remain valid for the life of the gadget or
  95.             until a new table is provided.
  96.  
  97.             Default is NULL, which causes a 1-to-1 mapping of pen numbers.
  98.  
  99.             Applicability is (OM_NEW, OM_SET, OM_GET)
  100.  
  101.         PALETTE_NumColours (UWORD)
  102.             Number of colors to display in the palette gadget.  Currently
  103.             this MUST be a power of 
  104.  
  105.             Defaults to 2.
  106.  
  107.             Applicability is (OM_NEW, OM_SET, OM_GET)
  108. palette_gc/--styleguide--                          palette_gc/--styleguide--
  109.  
  110.     PALETTE STYLE
  111.         The usability of a palette gadget decreases as the number of
  112.         colours it is displaying increases.  If there is a possibility
  113.         that your palette gadget may be displaying a large number of
  114.         colours (say, greater than 16), you should provide a means to
  115.         simplify the colour selection.  Two possibilities would be to
  116.         divide your colour palette into banks, and have users switch
  117.         banks via a chooser gadget for example.  Another possibility
  118.         would be to attach a scroller gadget to allow the user to
  119.         scroll through the available colours, displaying just a
  120.         subset of them on screen at a time.  You may also want to sort
  121.         your colours in some logical manner and use PALETTE_ColourTable.
  122. palette_gc/PALETTE_GetClass                      palette_gc/PALETTE_GetClass
  123.  
  124.     NAME
  125.         PALETTE_GetClass -- Gets the pointer to the palette class.
  126.  
  127.     SYNOPSIS
  128.         palette_class = PALETTE_GetClass();
  129.         D0
  130.  
  131.         Class * PALETTE_GetClass(VOID);
  132.  
  133.     FUNCTION
  134.         Obtains the pointer to the Palette gadget class for use with
  135.         NewObject().  This function always returns a valid pointer so
  136.         you do not need to check it.  The reason is that if the library
  137.         opens fine, then the pointer returned is already setup.  (Of course
  138.         this implies that if opening the library fails, you shouldn't be
  139.         calling this.)
  140.  
  141.         Note that this function does not create the class, that is done
  142.         when the class library is opened.
  143.  
  144.     INPUTS
  145.         Nothing.
  146.  
  147.     RESULT
  148.         palette_class - Pointer to the Palette gadget class.
  149.  
  150.     SEE ALSO
  151.